package com.bitin.adorn.demo.model;

import com.fasterxml.jackson.annotation.JsonManagedReference;
import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Entity
public class BankCard {

    @Id
    private Long id;

    private String name;

    @Enumerated(EnumType.STRING)
    private BankCardState state;

    //    //private Long uid;
//
//    @JsonManagedReference
//    @ManyToOne(
//            optional = false,
//            cascade = CascadeType.ALL
//    )
//    @JoinColumn(name = "uid", referencedColumnName = "id", nullable = false, updatable = false)
//    private User user;

    public BankCard approve() {
        this.state = BankCardState.UNPAID;
        return this;
    }
}
